#include "../h/QuantityObject.h"
#include <string>
#include <iostream.h>


		QuantityObject::QuantityObject()
		{
			amount = 0;
			name = "";
			ID = 0;
		}

		QuantityObject::QuantityObject(string _name,int _ID,double _amount)
		{
			name = _name;
			ID = _ID;
			amount = _amount;
		}

		QuantityObject::QuantityObject(string _name)
		{
			name = _name;
			ID = 0;
			amount = 1;
		}

		QuantityObject::QuantityObject(int _ID)
		{
			ID = _ID;
			name = "a";
			amount = 1;
		}

		QuantityObject::QuantityObject(string _name,double _amount)
		{
			name = _name;
			amount = _amount;
			ID = 0;
		}
		QuantityObject::QuantityObject(int _ID,double _amount)
		{
			name = "a";
			amount = _amount;
			ID = _ID;
		}

		QuantityObject* QuantityObject::copy()
		{
			QuantityObject* temp = new QuantityObject(name,ID,amount);
			return temp;
		}

	//	~QuantityObject()
	//	{

	//	}

		void QuantityObject::add()
		{
			amount++;
		}

		void QuantityObject::add(double _amount)
		{
			amount += _amount;
		}

		void QuantityObject::remove()
		{
			if(amount > 0)
			{
				amount--;
			}
			else std::cout <<"\n\n\n!!!!!ERROR!!!!!!\n\n\n"<<endl;
		}

		void QuantityObject::remove(double _amount)
		{
			if(amount - _amount >= 0)
			{
				amount -= _amount;
			}
			else std::cout <<"\n\n\n!!!!!ERROR!!!!!!\n\n\n"<<endl;
		}



		double QuantityObject::getAmount()
		{
			return amount;
		}

		int QuantityObject::getID()
		{
			return ID;
		}

		string QuantityObject::getName()
		{
			return name;
		}


